package com.ihr360.payroll.model.dto.attendance.rule.overtime;

import com.ihr360.commons.model.entity.NumberIdWithTime;
import com.ihr360.payroll.model.base.IBaseAttendanceRule;
import com.ihr360.payroll.model.dto.salary.meta.SalaryField;
import com.ihr360.payroll.type.BasementType;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToMany;
import javax.persistence.OneToOne;
import java.util.ArrayList;
import java.util.List;

/**
 * 综合工时扣款规则
 *
 * @author tomtao
 */
@Entity
public class SyntheticalDebitRule extends NumberIdWithTime<Long> implements IBaseAttendanceRule {

    @OneToOne
    private SyntheticalOverTimeRule rule;

    /**
     * 引用基数
     */
    @ManyToMany(fetch = FetchType.LAZY)
    private List<SalaryField> referenceFields = new ArrayList<>();

    /**
     * 固定基数
     */
    private Double fixedBase;


    public SyntheticalOverTimeRule getRule() {
        return rule;
    }

    public void setRule(SyntheticalOverTimeRule rule) {
        this.rule = rule;
    }

    public List<SalaryField> getReferenceFields() {
        return referenceFields;
    }

    public void setReferenceFields(List<SalaryField> referenceFields) {
        this.referenceFields = referenceFields;
    }

    @Override
    public Double getBaseRatio() {
        return null;
    }

    public Double getFixedBase() {
        return fixedBase;
    }

    @Override
    public Double getNumOpRatio() {
        return null;
    }

    @Override
    public BasementType getBasementType() {
        return null;
    }

    public void setFixedBase(Double fixedBase) {
        this.fixedBase = fixedBase;
    }
}
